<div id="information">
<br />
<?php
    if($_GET['check']!="check"){
	$sel_u = mysql_query('SELECT teacher_to FROM users WHERE `username` = "'.$_SESSION['username'].'"');
	$row_u = mysql_fetch_assoc($sel_u);
	
	$select_m=mysql_query('SELECT * FROM user_articles WHERE tutorial = "'.$row_u['teacher_to'].'" ORDER BY date_added DESC');
	if(mysql_num_rows($select_m)>0){
	?>
	<table border="0" style="border-collapse: collapse; margin-left: 20px; width: 650px; text-shadow: 1px 1px 1px #fff;">
	<tr style='background-color: #b7b6b6;'><td style="width: 150px;" align="center"><p><b>Тема</b></p></td><td style="width: 70px;" align="center"><p><b>От</b></p></td><td style="width: 100px;" align="center"><p><b>Място</b></p></td><td style="width: 200px;" align="center"><p><b>Статия</b></p></td></tr>
	<tr><td></td></tr><tr><td></td></tr><tr><td></td></tr>
	<?php
	while($row_m=mysql_fetch_assoc($select_m)){
	$_GET['id'] = $row_m['article_id'];
	echo '<tr style="height: 40px; background-color: #ede7e7; text-shadow: 3px 3px 3px #fff;"><td style="padding-left: 10px;"><b>'.$row_m['article_name'].'</b></td><td style="text-align: center">'.$row_m['from_who'].'</td><td style="text-align: center">'.$row_m['module'].'</td><td style="padding-right: 10px; text-align: center;"><a href="offered_articles.php?id='.$row_m['article_id'].'&amp;check='.check.'" class="message"><img src="../img/see.png" alt="see"/></a></td></tr><tr><td colspan="4" style="padding-left: 10px; padding-right: 10px;"><hr /></td></tr>';
	}
	?>
	</table>
	<?php
	}
	else{
	   echo "<p style='text-align: center; font-weight: bold;'>Няма предложени термини</p>";
	}
	}
	else {
	$select_m=mysql_query('SELECT * FROM termin_user WHERE id='.$_GET['id'].'');
    $row_m=mysql_fetch_assoc($select_m);
	?>
    <table border="0" style="border-collapse: collapse; margin-left: 20px; width: 650px; text-shadow: 1px 1px 1px #fff;">
      <tr style="background-color: #ede7e7;"><td align="right" style="width: 100px;"><p><b>Име</b></p></td><td align="left" style="padding-left: 20px;"><?php echo $row_m['termin']; ?></td></tr>
	  <tr><td colspan="2"><hr /></td></tr>
	  <tr style="background-color: #ede7e7;"><td align="right"><p><b>Описание</b></p></td><td align="left" style="padding-left: 20px;"><?php echo $row_m['opisanie']; ?></td></tr>
	  <tr><td colspan="2"><hr /></td></tr>
	  <tr style="background-color: #ede7e7;"><td align="right"><p><b>От</b></p></td><td align="left" style="padding-left: 20px;"><?php echo $row_m['username']; ?></td></tr>
	  <tr><td colspan="2"><hr /></td></tr>
	  <tr style="background-color: #ede7e7;"><td align="right"><p><b>Самоучител</b></p></td><td align="left" style="padding-left: 20px;"><?php echo $row_m['to_tutorial']; ?></td></tr>
	  <tr><td colspan="2"><hr /></td></tr>
	  <tr style="background-color: #ede7e7;"><td align="right"><p><b>Изпратено</b></p></td><td align="left" style="padding-left: 20px;"><?php echo date('d-m-Y', $row_m['date']); ?></td></tr>
    </table>   
	<form method="post" action="" class="form">
	   	  <p><input name="submit_faq" type="submit" value="Одобри термина" class="margin-left: 50px;"/>
	      <input type="hidden" name="termin_name" value="<?php echo $row_m['termin']; ?>"/>
		  <input type="hidden" name="termin_descr" value="<?php echo $row_m['opisanie']; ?>"/>
		  <input type="hidden" name="date_added" value="<?php echo $row_m['date']; ?>"/>
		  <input type="hidden" name="to_tutorial" value="<?php echo $row_m['to_tutorial']; ?>"/>
		  <input type="hidden" name="from_who" value="<?php echo $row_m['username']; ?>"/>
		  <input type="hidden" name="cat" value="<?php echo $row_m['cat']; ?>"/>
		  <input type="hidden" name="hide1" value="57"/></p>
	</form>
	<?php
	include "../php/offered_termins.php";
	}
	?>
</div>